fix: no-new-privileges-28 – prevent privilege escalation in mongodb_container#3424
fix: no-new-privileges-28 – prevent privilege escalation in mongodb_container#3424girichinna27 wants to merge 2 commits intoiluwatar:masterfrom
Conversation
…-28-iCwy4v0UzD fix: semgrep-no-new-privileges
PR SummaryAddresses a Semgrep security finding by hardening the Docker configuration to prevent privilege escalation. Adds runtime security option Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
Files Processed (1)
- caching/docker-compose.yml (1 hunk)
Actionable Comments (1)
-
caching/docker-compose.yml [37-38]
security: "Invalid syntax for no-new-privileges in docker-compose"
Skipped Comments (0)
| security_opt: | ||
| - no-new-privileges:true |
There was a problem hiding this comment.
The security option syntax is incorrect. In Docker Compose, security_opt accepts a list of strings like 'no-new-privileges'. The current code uses 'no-new-privileges:true', which is invalid YAML and will likely cause docker-compose to fail to apply the option. Change to:
security_opt:
- no-new-privileges
Also verify indentation aligns with other service keys and validate with 'docker-compose config' before merging.
|



Hi Maintainers 👋,
This Pull Request addresses a Semgrep security finding related to potential privilege escalation in the Docker configuration.
🔍 Issue Details
✅ Fix Applied
Added the following security hardening option to the mongodb_container service:
🎯 Impact
This change ensures that the container cannot gain additional privileges at runtime, effectively mitigating the risk of privilege escalation.
The issue was identified and remediated using AI-Guardian, a security analysis tool developed by my company OpsMx.
Thanks for your time and review 🙏